package com.heima.search.config;

import com.mongodb.client.MongoClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;

@Configuration//todo后面加的
   public class MongoConfig {
       @Bean
       public MongoTemplate mongoTemplate(MongoClient mongoClient) {
           return new MongoTemplate(mongoClient, "leadnews-history");
       }
   }
   